import random

from app import connect_database

con = connect_database()
cur = con.cursor()
typeList = ['mp3', 'wav', 'wma', 'ogg', 'flac']
weekList = ['周一', '周二', '周三','周四','周五','周六','周日']

for i in range(1, 1000):
    t = random.randint(1, 9)
    type = str(random.choice(typeList))
    week = str(random.choice(weekList))
    # print(f"INSERT INTO usage_history (user_id, usage_time, type, music_name, music_type, week, file_size, file_time) VALUES ({t}, '2025-{random.randint(1, 12)}-{random.randint(1, 27)}', 'separate', 'Timber-MattyBRaps.320', '{type}', '{week}', '8.53MB', '03:43')")
    cur.execute(f"INSERT INTO usage_history (user_id, usage_time, type, music_name, music_type, week, file_size, file_time) VALUES ({t}, '2025-3-{random.randint(1, 10)}', 'separate', 'Timber-MattyBRaps.320', '{type}', '{week}', '8.53MB', '03:43')")
    con.commit()

